﻿using System;
using System.Collections.Generic;
using UnityEngine;
using Utility;

namespace H
{
	// Token: 0x02000252 RID: 594
	public abstract class H_State : StateBase_WithMsg<H_State.Message>
	{
		// Token: 0x06000FCB RID: 4043 RVA: 0x00065EC4 File Offset: 0x000640C4
		protected H_State(H_Members members)
		{
			this.members = members;
		}

		// Token: 0x06000FCC RID: 4044 RVA: 0x00065ED4 File Offset: 0x000640D4
		public virtual void OnInput(H_INPUT input)
		{
		}

		// Token: 0x06000FCD RID: 4045 RVA: 0x00065ED8 File Offset: 0x000640D8
		protected void ChangeState(H_STATE next, H_State.Message msg)
		{
			this.members.StateMgr.ChangeState(next, msg);
		}

		// Token: 0x06000FCE RID: 4046 RVA: 0x00065EEC File Offset: 0x000640EC
		protected void ChangeState(H_STATE next)
		{
			this.members.StateMgr.ChangeState(next, null);
		}

		// Token: 0x06000FCF RID: 4047 RVA: 0x00065F00 File Offset: 0x00064100
		protected bool CheckChangePersonalityState()
		{
			if (this.members.param.continuanceXTC_F >= 3)
			{
				Female female = this.members.GetFemale(0);
				if (female.IsFloped())
				{
					if (!female.personality.ahe)
					{
						female.personality.ahe = true;
						female.personality.weakness = true;
						this.members.h_scene.StyleChangeUI.UpdateList();
						return true;
					}
				}
				else if (!female.personality.weakness)
				{
					female.personality.weakness = true;
					this.members.h_scene.StyleChangeUI.UpdateList();
					return true;
				}
			}
			return false;
		}

		// Token: 0x06000FD0 RID: 4048 RVA: 0x00065FB4 File Offset: 0x000641B4
		protected void CheckWeaknessStyle()
		{
			H_Scene h_scene = this.members.h_scene;
			H_StyleData styleData = this.members.StyleData;
			if (this.members.GetFemale(0).personality.weakness && styleData.state != H_StyleData.STATE.WEAKNESS)
			{
				string[] array = styleData.id.Split(new char[]
				{
					'_'
				}, StringSplitOptions.RemoveEmptyEntries);
				string text = "02";
				string id = string.Concat(new string[]
				{
					array[0],
					"_",
					array[1],
					"_",
					text,
					"_",
					array[3]
				});
				h_scene.ChangeStyle(id);
			}
		}

		// Token: 0x06000FD1 RID: 4049 RVA: 0x00066068 File Offset: 0x00064268
		protected void CheckUrine()
		{
			List<Female> females = this.members.GetFemales();
			for (int i = 0; i < females.Count; i++)
			{
				float num = 0.1f;
				if (females[i].personality.weakness)
				{
					num += 0.25f;
				}
				float num2 = UnityEngine.Random.Range(0f, 1f);
				if (num2 <= num)
				{
					females[i].urineParticle.Play();
					this.members.VoiceExpression(i, H_Voice.TYPE.INCONTINENCE);
				}
			}
		}

		// Token: 0x04001152 RID: 4434
		protected H_Members members;

		// Token: 0x02000253 RID: 595
		public interface Message
		{
		}

		// Token: 0x02000254 RID: 596
		public class BlendMessage : H_State.Message
		{
			// Token: 0x06000FD2 RID: 4050 RVA: 0x000660F4 File Offset: 0x000642F4
			public BlendMessage(float blend)
			{
				this.blend = blend;
			}

			// Token: 0x06000FD3 RID: 4051 RVA: 0x00066104 File Offset: 0x00064304
			public static float GetBlend(H_State.Message msg, float defBlend)
			{
				H_State.BlendMessage blendMessage = msg as H_State.BlendMessage;
				return (blendMessage == null) ? defBlend : blendMessage.blend;
			}

			// Token: 0x04001153 RID: 4435
			public float blend;
		}
	}
}
